package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("orders")
public class Order {
    
    @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;
    
    @TableField("user_id")
    private Integer userId;
    
    @TableField("total_amount")
    private BigDecimal totalAmount;
    
    @TableField("status")
    private OrderStatus status;
    
    @TableField("shipping_address")
    private String shippingAddress;
    
    @TableField("payment_method")
    private String paymentMethod;
    
    @TableField("created_at")
    private LocalDateTime createdAt;
    
    @TableField("updated_at")
    private LocalDateTime updatedAt;
    
    @TableField(exist = false)
    private User user;
    
    @TableField(exist = false)
    private List<OrderItem> orderItems;
    
    public enum OrderStatus {
        PENDING_PAYMENT, PAID, SHIPPED, DELIVERED, CANCELLED
    }
} 